package com.hundredapp.oa.repository;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.hundredapp.oa.dao.GenericDao;
import com.hundredapp.oa.domain.OaAction;
import com.hundredapp.oa.domain.OaSecuit;

@Repository
public class SecuitManagerImpl implements SecuitManager {

	@Autowired
	private GenericDao<OaSecuit, Integer> secuitDao;
	@Autowired
	private GenericDao<OaAction, Integer> actionDao;
	
	public GenericDao<OaSecuit, Integer> getSecuitDao() {
		return secuitDao;
	}

	public void setSecuitDao(GenericDao<OaSecuit, Integer> secuitDao) {
		this.secuitDao = secuitDao;
	}

	public GenericDao<OaAction, Integer> getActionDao() {
		return actionDao;
	}

	public void setActionDao(GenericDao<OaAction, Integer> actionDao) {
		this.actionDao = actionDao;
	}

	@Override
	public int add(OaSecuit secuit) {
		return secuitDao.save(secuit);
	}

	@Override
	public List<OaSecuit> findAllSecuit(String condition,int start,int limit) {
		return secuitDao.find(condition,start,limit);
	}

	@Override
	public OaSecuit findSecuitById(int id) {
		return secuitDao.findById(id);
	}

	@Override
	public void delete(int id) {
		// TODO Auto-generated method stub

	}

	@Override
	public void update(OaSecuit secuit) {
		secuitDao.modify(secuit);
	}

	@Override
	public int count(String condition) {
		return secuitDao.count(condition);
	}

}
